<template>
	<view class="all">
		<view class="top">
			<view class="top_box" @click="recharge">
				<image class="top_box_img" src="../../static/icon/6.png"></image>
				<view class="top_box_text">充值</view>
			</view>
			<view class="top_box" @click="withdraw">
				<image class="top_box_img" src="../../static/icon/9.png"></image>
				<view class="top_box_text">提现</view>
			</view>
			<view class="top_box" @click="interconvertibility">
				<image class="top_box_img" src="../../static/icon/7.png"></image>
				<view class="top_box_text">互转</view>
			</view>
			<view class="top_box" @click="conversion">
				<image class="top_box_img" src="../../static/icon/8.png"></image>
				<view class="top_box_text">兑换</view>
			</view>
		</view>
		<view class="original" @click="equity(user_list.jackpot_money)"> 原始股权 {{user_list.jackpot_money}} </view>
		<view class="list" @click="integral">
			<view class="list_top">
				<view class="list_top_text">绿色积分</view>
				<view>
					<uni-icons type="forward" size="20"></uni-icons>
				</view>
			</view>
			<view class="list_text">账户余额</view>
			<view class="list_texts">{{user_list.money}}</view>
		</view>
		<view class="list" @click="earnings" v-if="user_list.income == 1">
			<view class="list_top">
				<view class="list_top_text">收益积分</view>
				<view>
					<uni-icons type="forward" size="20"></uni-icons>
				</view>
			</view>
			<view class="list_text">账户余额</view>
			<view class="list_texts">{{user_list.dynamic_integral}}</view>
		</view>
		<view class="list" @click="deliver" v-if="user_list.away == 1">
			<view class="list_top">
				<view class="list_top_text">赠送积分</view>
				<view>
					<uni-icons type="forward" size="20"></uni-icons>
				</view>
			</view>
			<view class="list_text">账户余额</view>
			<view class="list_texts">{{user_list.static_integral}}</view>
		</view>
		<view class="list" @click="consumption">
			<view class="list_top">
				<view class="list_top_text">消费积分</view>
				<view>
					<uni-icons type="forward" size="20"></uni-icons>
				</view>
			</view>
			<view class="list_text">账户余额</view>
			<view class="list_texts">{{user_list.shopping_integral}}</view>
		</view>
		<view class="list" @click="bazaar">
			<view class="list_top">
				<view class="list_top_text">市场奖励</view>
				<view>
					<uni-icons type="forward" size="20"></uni-icons>
				</view>
			</view>
			<view class="list_text">账户余额</view>
			<view class="list_texts">{{user_list.no_integral}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user_list:{}
			}
		},
		onShow() {
			this.user_assets_api()
		},
		methods: {
			//首页
			user_assets_api() {
				var that = this
				that.$request(that.$Api.user_assets_api, {
					access_token: uni.getStorageSync('access_token'),
				}, "POST").then(res => {
					if (res.data.code == 0) {
						that.user_list = res.data.data
					} else {
						uni.showToast({
							title: res.data.msg,
							duration: 2000,
							icon: 'none'
						});
					}
				})
			},
			//市场
			bazaar() {
				uni.navigateTo({
					url:'../bazaar/bazaar'
				})
			},
			//消费
			consumption() {
				uni.navigateTo({
					url:'../consumption/consumption'
				})
			},
			//赠送
			deliver() {
				uni.navigateTo({
					url:'../deliver/deliver'
				})
			},
			//收益
			earnings() {
				uni.navigateTo({
					url:'../earnings/earnings'
				})
			},
			//积分
			integral() {
				uni.navigateTo({
					url:'../integral/integral'
				})
			},
			//原始股权
			equity(jackpot_money) {
				uni.navigateTo({
					url:'../equity/equity?jackpot_money='+jackpot_money
				})
			},
			//兑换
			conversion() {
				uni.navigateTo({
					url:'../conversion/conversion'
				})
			},
			//互转
			interconvertibility() {
				uni.navigateTo({
					url:'../interconvertibility/interconvertibility'
				})
			},
			//提现
			withdraw() {
				uni.navigateTo({
					url:'../withdraw/withdraw'
				})
			},
			//充值
			recharge() {
				uni.navigateTo({
					url:'../recharge/recharge'
				})
			},
		}
	}
</script>

<style lang="less">
	page{
		.all{
			.list{
				.list_texts{
					font-size: 36upx;
					font-weight: bold;
					color: #ff0000;
					padding-bottom: 22upx;
					border-bottom: 1upx solid #eee;
				}
				.list_text{
					font-size: 28upx;
					color: #999;
					font-weight: bold;
					padding: 20upx 0;
				}
				.list_top{
					.list_top_text{
						font-size: 36upx;
						font-weight: bold;
					}
					width: 700upx;
					display: flex;
					justify-content: space-between;
				}
				width: 700upx;
				padding: 25upx;
			}
			.original{
				width: 50%;
				padding: 10upx 20upx;
				text-align: left;
				font-size: 28upx;
				background: #fcf1dc;
				color: #dec199;
				border-radius: 40upx;
				margin-top: 40upx;
				margin-left: 25upx;
			}
			.top{
				.top_box{
					.top_box_img{
						width: 60upx;
						height: 60upx;
					}
					.top_box_text{
						font-size: 28upx;
						color: #f0f0d9;
					}
				}
				width: 700upx;
				padding: 30upx 0;
				margin-top: 25upx;
				margin-left: 25upx;
				background: #39384f;
				display: flex;
				justify-content: space-around;
				border-radius: 40upx 40upx 0upx 0upx;
			}
		}
	}
</style>
